<?php /**
*DomainObjectCollection Collection for holding objects of type DomainObject.
*
*Might seem strange to have a collection to store other collections but it makes
*sense in certain iterator situations
*@package Business
*@author Garry Willits
*@copyright 2005
*@version 1.1
*/

class CollectionCollection extends Collection{

/**
*wraps parent class
*@param ViewHelper
*/
public function __construct( $object=null ){
if( isset($object) ){
    if( ! $object instanceof Collection ){
      throw new Exception( "This collection only holds objects of type Collection ");
    }
}
parent::__construct( $object );
}
/**
*Add element to collection
*@param ViewHelper
*@param int
*/
public function addElement( Collection $object , $key=null){
    if( !isset($key) ){
    $this->doAddElement ( $object);
    }
    else {
    $this->doAddElementByKey ( $object , $key );
    }
}
}


?>
